<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2019/12/11
  Time: 9:05
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>Title</title>
</head>
<body>
    <center>
        <table border="1" rules="all">
            <tr align="center" bgcolor="#ffc0cb">
                <th>部门编号</th>
                <th>部门名称</th>
                <th>员工数量</th>
                <th colspan="100">操作<a href="toAddUser.do">新增</a></th>
            </tr>
            <c:forEach items="${list}" var="d">
                <tr align="center">
                    <td>${d.deptid}</td>
                    <td>${d.dname}</td>
                    <td>${d.ubs.size()}</td>
                    <td><button type="button" onclick="getDeptUser(${d.deptid})">查看员工</button></td>
                    <td><a href="toDeptRole.do?deptid=${d.deptid}"><button>分配角色</button></a></td>
                </tr>
            </c:forEach>
        </table>

    </center>
</body>
<script>
    function getDeptUser(deptid) {
        window.open("getDeptUser.do?deptid="+deptid,"_blank","height=200px,width=300px");
    }
</script>
</html>
